home *** CD-ROM | disk | FTP | other *** search
/ Champak 109 / Vol 109.iso / games / race_gam.swf / scripts / DefineSprite_102 / frame_1 / DoAction.as
Encoding:
Text File  |  2008-11-12  |  6.6 KB  |  234 lines

  1. var ┬º\x01┬º = 969;
  2. while(true)
  3. {
  4.    if(eval("\x01") == 969)
  5.    {
  6.       set("\x01",eval("\x01") - 874);
  7.       ┬º┬ºpush(true);
  8.    }
  9.    else if(eval("\x01") == 95)
  10.    {
  11.       set("\x01",eval("\x01") + 31);
  12.       if(┬º┬ºpop())
  13.       {
  14.          set("\x01",eval("\x01") + 503);
  15.       }
  16.    }
  17.    else if(eval("\x01") == 629)
  18.    {
  19.       set("\x01",eval("\x01") + 106);
  20.       ┬º┬ºpush(true);
  21.    }
  22.    else
  23.    {
  24.       if(eval("\x01") == 126)
  25.       {
  26.          set("\x01",eval("\x01") + 503);
  27.          break;
  28.       }
  29.       if(eval("\x01") == 735)
  30.       {
  31.          set("\x01",eval("\x01") + 12);
  32.          if(┬º┬ºpop())
  33.          {
  34.             set("\x01",eval("\x01") - 588);
  35.          }
  36.       }
  37.       else if(eval("\x01") == 946)
  38.       {
  39.          set("\x01",eval("\x01") - 400);
  40.          if(┬º┬ºpop())
  41.          {
  42.             set("\x01",eval("\x01") - 198);
  43.          }
  44.       }
  45.       else
  46.       {
  47.          if(eval("\x01") == 747)
  48.          {
  49.             set("\x01",eval("\x01") - 588);
  50.             break;
  51.          }
  52.          if(eval("\x01") != 159)
  53.          {
  54.             if(eval("\x01") == 546)
  55.             {
  56.                set("\x01",eval("\x01") - 198);
  57.                ┬º┬ºpop();
  58.                break;
  59.             }
  60.             if(eval("\x01") == 348)
  61.             {
  62.                set("\x01",eval("\x01") + 530);
  63.                view_txt = "ROUND " + _parent.course_no;
  64.                if(_parent.course_no == 5)
  65.                {
  66.                   view_txt = "FINAL";
  67.                }
  68.                xmax = 16;
  69.                ymax = 16;
  70.                celmax = xmax * ymax;
  71.                xadd = [0,1,0,-1];
  72.                yadd = [-1,0,1,0];
  73.                xadd2 = [0,1,1,1,0,-1,-1,-1];
  74.                yadd2 = [-1,-1,0,1,1,1,0,-1];
  75.                nmap = new Array(celmax);
  76.                i = 0;
  77.                while(i < celmax)
  78.                {
  79.                   nmap[i] = i;
  80.                   i++;
  81.                }
  82.                i = 0;
  83.                while(i < celmax)
  84.                {
  85.                   r = Math.floor(Math.random() * celmax);
  86.                   tmp = nmap[i];
  87.                   nmap[i] = nmap[r];
  88.                   nmap[r] = tmp;
  89.                   i++;
  90.                }
  91.                imap = new Array(celmax);
  92.                i = 0;
  93.                while(i < celmax)
  94.                {
  95.                   imap[i] = 0;
  96.                   i++;
  97.                }
  98.                input_imap(136);
  99.                loop_max = 5 + _parent.course_no * 3;
  100.                loop = 0;
  101.                while(loop < loop_max)
  102.                {
  103.                   max = -1;
  104.                   n = 0;
  105.                   i = 0;
  106.                   while(i < celmax)
  107.                   {
  108.                      if(imap[i] == 2)
  109.                      {
  110.                         if(nmap[i] > max)
  111.                         {
  112.                            max = nmap[i];
  113.                            n = i;
  114.                         }
  115.                      }
  116.                      i++;
  117.                   }
  118.                   if(max < 0)
  119.                   {
  120.                      break;
  121.                   }
  122.                   input_imap(n);
  123.                   loop++;
  124.                }
  125.                c = 0;
  126.                i = 0;
  127.                while(i < ymax)
  128.                {
  129.                   j = 0;
  130.                   while(j < xmax)
  131.                   {
  132.                      if(imap[c] == 1)
  133.                      {
  134.                         k = 0;
  135.                         while(k < 8)
  136.                         {
  137.                            x = j + xadd2[k];
  138.                            y = i + yadd2[k];
  139.                            n = y * xmax + x;
  140.                            if(imap[n] != 1)
  141.                            {
  142.                               imap[n] = 2;
  143.                            }
  144.                            k++;
  145.                         }
  146.                      }
  147.                      c++;
  148.                      j++;
  149.                   }
  150.                   i++;
  151.                }
  152.                while(true)
  153.                {
  154.                   flg = 0;
  155.                   i = 0;
  156.                   while(i < ymax)
  157.                   {
  158.                      j = 0;
  159.                      while(j < xmax - 3)
  160.                      {
  161.                         n = i * xmax + j;
  162.                         if(imap[n] == 1 && imap[n + 1] == 2 && imap[n + 2] == 1)
  163.                         {
  164.                            imap[n + 1] = 1;
  165.                            flg = 1;
  166.                         }
  167.                         j++;
  168.                      }
  169.                      i++;
  170.                   }
  171.                   j = 0;
  172.                   while(j < xmax)
  173.                   {
  174.                      i = 0;
  175.                      while(i < ymax - 3)
  176.                      {
  177.                         n = i * xmax + j;
  178.                         if(imap[n] == 1 && imap[n + xmax] == 2 && imap[n + xmax * 2] == 1)
  179.                         {
  180.                            imap[n + xmax] = 1;
  181.                            flg = 1;
  182.                         }
  183.                         i++;
  184.                      }
  185.                      j++;
  186.                   }
  187.                   i = 0;
  188.                   while(i < ymax)
  189.                   {
  190.                      j = 0;
  191.                      while(j < xmax - 4)
  192.                      {
  193.                         n = i * xmax + j;
  194.                         if(imap[n] == 1 && imap[n + 1] == 2 && imap[n + 2] == 2 && imap[n + 3] == 1)
  195.                         {
  196.                            imap[n + 1] = 1;
  197.                            imap[n + 2] = 1;
  198.                            flg = 1;
  199.                         }
  200.                         j++;
  201.                      }
  202.                      i++;
  203.                   }
  204.                   j = 0;
  205.                   while(j < xmax)
  206.                   {
  207.                      i = 0;
  208.                      while(i < ymax - 4)
  209.                      {
  210.                         n = i * xmax + j;
  211.                         if(imap[n] == 1 && imap[n + xmax] == 2 && imap[n + xmax * 2] == 2 && imap[n + xmax * 3] == 1)
  212.                         {
  213.                            imap[n + xmax] = 1;
  214.                            imap[n + xmax * 2] = 1;
  215.                            flg = 1;
  216.                         }
  217.                         i++;
  218.                      }
  219.                      j++;
  220.                   }
  221.                   if(flg == 0)
  222.                   {
  223.                      break;
  224.                   }
  225.                }
  226.             }
  227.             break;
  228.          }
  229.          set("\x01",eval("\x01") + 787);
  230.          ┬º┬ºpush(true);
  231.       }
  232.    }
  233. }
  234.